package com.sunwayworld.basemodule.rm.equipment.repair.controller.impl;

import com.sunwayworld.framework.utils.ServletUtils;
import org.springframework.stereotype.Controller;
import com.sunwayworld.framework.spring.annotation.GikamBean;
import com.sunwayworld.basemodule.rm.equipment.repair.controller.LimsEquiptRepairController;
import com.sunwayworld.framework.log.annotation.Log;
import com.sunwayworld.framework.log.annotation.LogType;

import javax.servlet.http.HttpServletRequest;

@Controller
@GikamBean
public class LimsEquiptRepairControllerImpl implements LimsEquiptRepairController {

    @Log(value = "设备维修表编制列表页", type = LogType.CONTROLLER)
    @Override
    public String editListPage() {
        return "basemodule/rm/equipment/equipt-repairs/lims-equipt-repair-edit-list";
    }

    @Log(value = "设备维修表详情页", type = LogType.CONTROLLER)
    @Override
    public String detailPage() {
        return "basemodule/rm/equipment/equipt-repairs/lims-equipt-repair-detail";
    }

    @Log(value = "设备维修表审核列表页", type = LogType.CONTROLLER)
    @Override
    public String auditListPage() {
        HttpServletRequest currentRequest = ServletUtils.getCurrentRequest();
        String bpmn_statusCode = currentRequest.getParameter("bpmn_statusCode");

        String path = "basemodule/rm/equipment/equipt-repairs/lims-equipt-repair-audit-list";
        if ("Audit".equals(bpmn_statusCode)) {
            path = "basemodule/rm/equipment/equipt-repairs/lims-equipt-repair-audit-list";
        }else if ("Implement".equals(bpmn_statusCode)){
            path = "basemodule/rm/equipment/equipt-repairs/lims-equipt-repair-implement-list";
        }else if ("Affirm".equals(bpmn_statusCode)){
            path = "basemodule/rm/equipment/equipt-repairs/lims-equipt-repair-affirm-list";
        }
        return path;
    }

    @Log(value = "设备维修表查询列表页", type = LogType.CONTROLLER)
    @Override
    public String searchListPage() {
        return "basemodule/rm/equipment/equipt-repairs/lims-equipt-repair-search-list";
    }

    @Log(value = "设备维修表选择列表页", type = LogType.CONTROLLER)
    @Override
    public String choosePage() {
        return "basemodule/rm/equipment/equipt-repairs/lims-equipt-repair-choose-list";
    }

}
